<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>时间戳</title>
    <script>
        //1.获得Date总的毫秒数 1970-1-1
        var date = new Date();
        console.log(date.valueOf());
        console.log(date.getTime());
        //2.简单写法(最常用写法)
        var date1 = +new Date();
        console.log(date1);
        //3.H5新增的方法 获取总的时间毫秒值
        console.log(Date.now());
    </script>
</head>

<body>

</body>

</html>